import bsddb
import sys

if len(sys.argv) > 1:
    db = bsddb.btopen(sys.argv[1],'r')
    while True:
        try:
            print db.next()
        except:
            break
else:
    print 'ERROR: Please run as \'python viewdb.py [db name]\''
